#!/bin/bash

files = ""
for FileOrDir; do
	files="$files $FileOrDir"
done

name=$(zenity --title="文件压缩" --text "压缩文件名?" --entry)
pass=$(zenity --title="文件加密" --cancel-label="免密码" --ok-label="设置密码" --password)

if [ "$pass" != "" ]; then
	7za a -p$pass $name $files
else
	7za a $name $files
fi

notify-send "$name文件，压缩完毕"
